﻿using System;
using System.Xml.Serialization;
using PSE.Deployment.SetupBase.Configuration.Enums;

namespace PSE.Deployment.SetupBase.Configuration
{
    [Serializable]
    public class Queue
    {
        [XmlAttribute()]
        public string MachineName { get; set; }
        [XmlAttribute()]
        public string QueueName { get; set; }
        [XmlAttribute()]
        public bool NoQueuePermitedInstallation { get; set; }
        public QueueLocationType LocationType { get; set; }
        public QueueInstallationType InstallationType { get; set; }
        [XmlAttribute()]
        public string FullPath
        {
            get
            {
                string path = string.Empty;

                if (!string.IsNullOrEmpty(QueueName))
                {
                    if (InstallationType == QueueInstallationType.Local)
                        path = ".";
                    else
                        path = MachineName;

                    if (LocationType == QueueLocationType.Private)
                        path = path + @"\private$";

                    path = path + @"\" + QueueName;
                }

                return path;
            }
            set { } 
        }
    }
}
